package cn.myplus.examples.springbootswagger.users

import org.springframework.stereotype.Service

@Service
class UserService {
    fun getUserById(id: String): User {
        if (id.isBlank()) {
            throw IllegalArgumentException("查询用户,id 参数为空.")
        }
        return User("admin", "系统管理员", "admin")
    }

    fun getUsers(): MutableIterable<User> {
        val users = mutableListOf<User>()
        for (i in 0..14) {
            users.add(User("admin$i", "系统管理员$i", "admin$i"))
        }
        return users
    }
}